home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Network Support Library
/
RoseWare - Network Support Library.iso
/
logbatch
/
chkeys.exe
/
CHECKEYS.DOC
< prev
next >
Wrap
Text File
|
1993-10-29
|
3KB
|
89 lines
Check Keys - DEMO FILES
ChkShift, ChkAlt, ChkCtrl
(c) Copyright 1993, Paradigm Software, All Rights Reserved
These 3 utilities will check to see if the shift, alt or ctrl key
is being held down. If so, they will set the DOS errorlevel in
order to stop batch file processing. They can help you setup a
conditional batch file with a default action. They will not stop
processing if the user did not hold the key down.
Usage
CHKSHIFT
CHKALT
CHKCTRL
No parameters are required
Examples
The following example shows how to adjust a sample autoexec.bat file
to use the programs for some conditional processing.
___________________________________________________________
@ECHO OFF
SET PATH=C:\DOS;C:\UTILS;C:\NU70
SET TEMP=C:\DOS
DOSKEY
rem Give the user a chance to cancel the network driver load
ECHO ***** Hold the SHIFT key to stop the network drivers ******
chkshft
IF ERRORLEVEL 1 GOTO TRYNDD
rem We'll only get here if the user did NOT press the SHIFT key
CALL C:\NWCLIENT\STARTNET.BAT
:TRYNDD
rem Don't run Norton's Disk Doctor unless the user tells us to
rem Note: this is trickier because we don't want to run by
rem default
ECHO ***** Hold the ALT key to run Norton Disk Doctor ******
chkalt
IF ERRORLEVEL 1 GOTO RUNNDD
rem Since they did not press the Alt key, bounce by NDD
GOTO TAPE
:RUNNDD
NDD C: /QUICK
:TAPE
rem Give the user a chance to cancel the auto tape backup
ECHO ***** Hold the CTRL key to stop the hard drive backup *****
chkctrl
IF ERRORLEVEL 1 GOTO END
CALL C:\TAPE\DRIVEC.BAT
:END
rem End File
___________________________________________________________
The above example shows how to make the default action either do
something if the user held the key, or ignore something.
Return Codes
0 - The key was not held
1 - The user did hold the key
Notes
These programs will ask for confirmation before they assume the user
meant to press the key. This should prevent events from taking place
because a PC was turned on with some paperwork laying on the keyboard!
The user MUST HOLD the keys down. Pressing the key once and then
letting go may not be enough to make the program notice the key
was pressed.
The next versions of these programs will include some parameters to
change the messages the programs display, the delay time, confirmation,
etc. The next version will be posted free of charge for REGISTERED
users on CompuServe. You will be notified when they are ready.
Company Contact
Paradigm Software $30 for a single server license
1333-C Shepard Drive $10 for a single user license
Sterling, VA 20164
(703) 450-0829
(703) 450-2683 FAX